package net.huashitong.ssydt.money.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 统一下订单
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.08.15
 */
@ApiModel(value ="Order", description = "订单对象")
public class OrderInVO implements Serializable {

    @ApiModelProperty(value = "商品对象", required = true)
    private List<Goods> goodses;

    @ApiModelProperty(value = "终端（Android,iOS,Web）", required = true)
    @NotBlank(message = "终端不能为空")
    private String terminal;//终端（android,ios,web）

    @ApiModelProperty(value = "设备码")
    private String deviceCode;//设备码

    @ApiModelProperty(value = "设备类型（硬件型号）")
    private String deviceType;//设备类型（硬件型号）

    @ApiModelProperty(value = "设备系统")
    private String deviceOperation;//设备系统

    @ApiModelProperty(value = "软件版本（应用版本）")
    private String clientVersion;//软件版本（应用版本）

    public List<Goods> getGoodses() {
        return goodses;
    }

    public void setGoodses(List<Goods> goodses) {
        this.goodses = goodses;
    }

    public String getTerminal() {
        return terminal;
    }

    public void setTerminal(String terminal) {
        this.terminal = terminal;
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getDeviceOperation() {
        return deviceOperation;
    }

    public void setDeviceOperation(String deviceOperation) {
        this.deviceOperation = deviceOperation;
    }

    public String getClientVersion() {
        return clientVersion;
    }

    public void setClientVersion(String clientVersion) {
        this.clientVersion = clientVersion;
    }

    /**
     * 商品对象
     * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
     * @since 2017.08.15
     */
    @ApiModel(value ="Goods", description = "商品对象")
    public static class Goods {

        @ApiModelProperty(value = "商品id", required = true)
        @NotBlank(message = "商品id不能为空")
        private Long goodsId;//商品id

        @ApiModelProperty(value = "商品类型(01 vip套餐, 02 金币套餐，03 商品 )", required = true)
        @NotBlank(message = "商品类型不能为空")
        private String goodsType;//商品类型

        @ApiModelProperty(value = "数量", required = true)
        @NotNull(message = "数量为空")
        @Min(value = 1,message ="数量不能小于{value}" )
        private Integer number;//数量

        public Long getGoodsId() {
            return goodsId;
        }

        public void setGoodsId(Long goodsId) {
            this.goodsId = goodsId;
        }

        public String getGoodsType() {
            return goodsType;
        }

        public void setGoodsType(String goodsType) {
            this.goodsType = goodsType;
        }

        public Integer getNumber() {
            return number;
        }

        public void setNumber(Integer number) {
            this.number = number;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("Goods{");
            sb.append("goodsId='").append(goodsId).append('\'');
            sb.append(", goodsType='").append(goodsType).append('\'');
            sb.append(", number=").append(number);
            sb.append('}');
            return sb.toString();
        }
    }


}
